import sys

from PySide2.QtCore import Qt
from PySide2.QtWidgets import QApplication, QGridLayout, QLabel, QMainWindow, QWidget

from color_widget import ColorWidget

class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("GridLayout Sample")
        self.setFixedSize(500, 400)
        
        layout = QGridLayout()        
        layout.addWidget(ColorWidget("red"), 0, 0)
        layout.addWidget(ColorWidget("green"), 1, 0)
        layout.addWidget(ColorWidget("blue"), 1, 1)
        layout.addWidget(ColorWidget("purple"), 2, 2)

        widget = QWidget()
        widget.setLayout(layout)
        self.setCentralWidget(widget)

app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec_()
